import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";
// import IpView from "@/views/ip-address-select/index.vue";
import {Component} from "vue";
import {
  ConstructOutline,
  ExtensionPuzzleOutline,
  LockClosedOutline,
  GameControllerOutline,
  HeartOutline,
  DesktopOutline,
  GlobeOutline,
  TerminalOutline,
  LogoGithub,
  DocumentTextOutline,
  TextOutline,
  ServerOutline,
  LinkOutline,
  DiceOutline,
  LanguageOutline,
  ImageOutline,
  ShieldCheckmarkOutline,
  CodeSlashOutline,
  KeyOutline,
  HandRightOutline,
  PersonOutline,
  ColorPaletteOutline,
  GitCompareOutline,
  FlashOutline,
  VolumeHighOutline,
  BriefcaseOutline,
  ClipboardOutline,
  QrCodeOutline,
  PersonOutline
} from '@vicons/ionicons5'

export interface meta {
  title?: string,
  icon?: Component,
  hidden?: boolean
}


const routes: RouteRecordRaw[] = [
    {
      path: '/',
      redirect: '/home',
      meta: {
        hidden: true,
      }
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/home.vue'),
      meta: {
        hidden: true
      }
    },
    {
      path: '/utilityTool',
      name: 'utilityTool',
      meta: {
        title: '实用工具',
        icon: ConstructOutline,
      },
      children: [
        {
          path: 'ipAddressSelect',
          component: () => import('@/views/utility-tool/ip-address-select/index.vue'),
          meta: {
            title: 'IP地址反查',
            icon: GlobeOutline
          }
        },
        {
          path: 'randomCharacterGenerate',
          component: () => import('@/views/utility-tool/random-character-generate/index.vue'),
          meta: {
            title: '随机字符生成器',
            icon: DiceOutline
          },
          props() {
            return {
              pageTitle: '随机字符生成器'
            }
          }
        },
        {
          path: 'translation',
          component: () => import('@/views/utility-tool/translation/index.vue'),
          meta: {
            title: '翻译工具',
            icon: LanguageOutline
          }
        },
        {
          path: 'svgGenerate',
          component: () => import('@/views/utility-tool/svg-generate/index.vue'),
          meta: {
            title: 'SVG图片生成',
            icon: ImageOutline
          }
        },
        {
          path: 'tableComparison',
          component: () => import('@/views/utility-tool/table-comparison/index.vue'),
          meta: {
            title: '表格对比',
            icon: GitCompareOutline
          }
        },
        // {
        //   path: 'textComparison',
        //   component: () => import('@/views/utility-tool/text-comparison/index.vue'),
        //   meta: {
        //     title: '文本对比',
        //     icon: GitCompareOutline
        //   }
        // },
        {
          path: 'clipboard',
          component: () => import('@/views/utility-tool/clipboard/index.vue'),
          meta: {
            title: '网络剪贴板',
            icon: ClipboardOutline
          }
        },
        {
          path: 'qrcodeGenerator',
          component: () => import('@/views/utility-tool/qrcode-generator/index.vue'),
          meta: {
            title: '二维码生成器',
            icon: QrCodeOutline
          }
        }
      ]
    },
    {
      path: '/developTool',
      name: 'developTool',
      meta: {
        title: '开发工具',
        icon: TerminalOutline
      },
      children: [
        {
          path: 'githubUtil',
          component: () => import('@/views/develop-tool/github-util/index.vue'),
          meta: {
            title: 'github加速',
            icon: LogoGithub
          }
        },
        {
          path: 'propertiesConvertYml',
          component: () => import('@/views/develop-tool/properties-convert-yml/index.vue'),
          meta: {
            title: 'properties&&yml互转',
            icon: DocumentTextOutline
          }
        },

        {
          path: 'nameFormatConvert',
          component: () => import('@/views/develop-tool/name-format-convert/index.vue'),
          meta: {
            title: '命名风格转换',
            icon: TextOutline
          }
        },
        {
          path: 'mybatisLogExtract',
          component: () => import('@/views/develop-tool/mybatis-log-extract/index.vue'),
          meta: {
            title: 'mybatis日志提取',
            icon: ServerOutline
          }
        },
        {
          path: 'curlTools',
          component: () => import('@/views/develop-tool/curl-tools/index.vue'),
          meta: {
            title: 'curl工具集',
            icon: LinkOutline
          }
        }
      ]
    },
    {
      path: '/frameworkDemo',
      name: 'frameworkDemo',
      meta: {
        title: '框架接入示例',
        icon: ExtensionPuzzleOutline
      },
      children: [
        {
          path: 'anjiCaptcha',
          component: () => import('@/views/framework-demo/anji-captcha/index.vue'),
          meta: {
            title: '安吉验证码',
            icon: ShieldCheckmarkOutline
          }
        }
      ]
    },
    {
      path:'/encryptionAndDecryption',
      name: 'encryptionAndDecryption',
      meta: {
        title: '编码解码/加密解密',
        icon: LockClosedOutline
      },
      children:[
        {
          path: 'unicodeConvert',
          component: () => import('@/views/encryption-and-decryption/unicode-convert/index.vue'),
          meta: {
            title: 'Unicode编码转换',
            icon: CodeSlashOutline
          },
          props() {
            return {
              pageTitle: 'Unicode编码转换'
            }
          }
        },
        {
          path: 'aesConvert',
          component: () => import('@/views/encryption-and-decryption/aes-convert/index.vue'),
          meta: {
            title: 'AES加解密',
            icon: KeyOutline
          },
          props() {
            return {
              pageTitle: 'AES加解密'
            }
          }
        },
        {
          path: 'desConvert',
          component: () => import('@/views/encryption-and-decryption/des-convert/index.vue'),
          meta: {
            title: 'DES加解密',
            icon: KeyOutline
          },
          props() {
            return {
              pageTitle: 'DES加解密'
            }
          }
        },
        {
          path: 'urlConvert',
          component: () => import('@/views/encryption-and-decryption/url-convert/index.vue'),
          meta: {
            title: 'URL',
            icon: LinkOutline
          },
          props() {
            return {
              pageTitle: 'URL编码/解码'
            }
          }
        }
      ]
    },
    {
      path: '/ai',
      name: 'ai',
      meta: {
        title: 'AI工具',
        icon: FlashOutline,
      },
      children: [
        {
          path: 'tts',
          component: () => import('@/views/ai/tts/index.vue'),
          meta: {
            title: '文本转语音',
            icon: VolumeHighOutline
          }
        }
      ]
    },
    {
      path: '/entertainment',
      name: 'entertainment',
      meta: {
        title: '娱乐❀',
        icon: GameControllerOutline,
      },
      children: [
        {
          path: 'palmReading',
          component: () => import('@/views/entertainment/palm-reading/index.vue'),
          meta: {
            title: 'AI手相分析',
            icon: HandRightOutline
          }
        },
        {
          path: 'jobWorth',
          component: () => import('@/views/entertainment/job-worth/index.vue'),
          meta: {
            title: '这班上的值不值',
            icon: BriefcaseOutline
          }
        },
        {
          path: 'nameAnalysis',
          component: () => import('@/views/entertainment/name-analysis/index.vue'),
          meta: {
            title: 'AI测姓名',
            icon: PersonOutline
          }
        }
      ]
    },
    {
      path: '/websiteGenerate',
      name: 'websiteGenerate',
      meta: {
        title: '网页生成',
        icon: DesktopOutline,
      },
      children: [
        {
          path: 'qixiSpecial',
          component: () => import('@/views/entertainment/website-generate/index.vue'),
          meta: {
            title: '七夕特供',
            icon: HeartOutline
          }
        }
      ]
    },
    {
      path: '/website/template',
      meta: {
        hidden: true
      },
      children: [
        {
          path: 'qixi-festival',
          component: () => import('@/views/web-site-template/qixi-festival/index.vue'),
        }
      ]
    },
];

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
